{% load article_simple_tag %}
<form id="pagerForm" method="post" action="{% url 'article_management' %}">
    {% csrf_token %}

	<input type="hidden" name="pageNum" value="{{ pageNum }}" />
	<input type="hidden" name="numPerPage" value="{{ numPerPage }}" />

</form>


<div class="pageHeader">

</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="{% url 'article_management' %}add/0/" target="dialog"  rel="article_add" width="1000" height="768" title="添加文章"><span>添加</span></a></li>
            <li><a class="edit" href="{% url 'article_management' %}update/{sid_user}/" target="dialog" rel="article_update" width="1000" height="768" title="修改文章"><span>修改</span></a></li>
            <li><a class="delete" href="{% url 'article_management' %}del/{sid_user}/" target="ajaxTodo" title="确定要删除吗?" callback="dialogAjaxDone"><span>删除</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th>id</th>
				<th>标题名称</th>
				<th>内容</th>
				<th>是否发布</th>
				<th>创建人</th>
				<th>创建时间</th>
				<th>预览</th>
			</tr>
		</thead>
		<tbody>

            {% for obj in article_objs %}
                <tr target="sid_user" rel="{% get_id obj %}">
                    <td>{{ forloop.counter }}</td>
                    <td>{{ obj.title }}</td>
                    <td>{% str_cut obj.content 100  %}</td>
                    <td>{% if obj.show == 1 %}是{% elif obj.show == 0 %}否{% endif %}</td>
                    <td>{% get_create_username user_data obj.create_user_id %}</td>
                    <td>{{ obj.create_date|date:"Y-m-d H:i:s" }}</td>
                    <td><a href="{% url 'article_management' %}preview/{% get_id obj %}/" target="_blank">预览</a></td>
                </tr>
            {% endfor %}


		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="4" {% if numPerPage == 4 %}selected{% endif %}>4</option>
				<option value="20" {% if numPerPage == 20 %}selected{% endif %}>20</option>
				<option value="50" {% if numPerPage == 50 %}selected{% endif %}>50</option>
				<option value="100" {% if numPerPage == 100 %}selected{% endif %}>100</option>
				<option value="200" {% if numPerPage == 200 %}selected{% endif %}>200</option>
			</select>
			<span>条，共{{ count }}条</span>
		</div>

		<div class="pagination" targetType="navTab" totalCount="{{ count }}" numPerPage="{{ numPerPage }}" pageNumShown="10" currentPage="{{ pageNum }}"></div>

	</div>
</div>
